Okay so last lesson we looked at attachments.
And there's a very quick lesson just explaining you know how to set them up.
And today we're going to look at one of the first, the first of I think the two major uses of attachments
which is to do a part effects.
Okay.
Now we've already looked at part effects in the previous section.
We looked at the most basic ones.
So add a part in I can quickly show you again, um, which is I believe the um, the smoke, the fire
and the explosion we looked at.
We also looked at the particle emitter and the sparkle.
So quite a few there.
Now these all benefit from attachments.
You don't need to use attachments for them, but they benefit a bit from them.
So what I mean by this is if we have this part here and we scale up a bit more like this here, and
we add a fire effect in here, you might be able to see a bit of an issue.
This part has all of this kind of surface area.
But the fire is default in the middle and there's no way to change that okay.
Because you can't go in and change a position value like you can for explosion, for example.
It's just default in the center, which is a bit of an issue.
Now say you wanted this fire to be on.
Like, you know, this bit over here, for example.
That's where an attachment can come in.
If you add an attachment into this part and actually put the fire inside of the attachments and then
move the attachment, you can see I can move where the fire is on this part.
Okay.
Now this is the same as like adding in a second part and then adding the fire inside of that second
part.
But I think it's a bit more of a better way to do it, because if you have a part inside of each other,
um, it could affect some scripts, it could change some physics stuff.
Um, if you have can collide on, for example.
So it's just a bit of a simpler way to do it.
Um, so you can see we can corner it over there.
So it's now in this center bit here.
Okay.
And of course you can change a couple of these.
Um, you can copy and paste these and add multiple fires into one object like that there.
Okay.
So really good use of that there okay.
And you can do that with the smoke, the sparkles and all that other kind of stuff as well.
Okay.
So that's kind of first use when it comes to um part effects.
And the second use is two part effects, which I haven't actually discussed yet.
So when we looked at part effects I showed you a couple of them.
Um, but there were a couple that I left out on purpose because they involved using attachments.
Okay.
So these two, um, let's quickly add Martin again.
These two are called the trail and the beam.
So these two require attachments in order to work.
Okay.
So um, obviously you need to be using attachments in order to use to work.
Okay.
So click on one of them and we're not going to talk too much about that properties today.
There are a couple new ones.
But majority of their properties um are the same if not very similar to ones we've looked at before
basically.
Okay, um, the only difference is the setup with attachments.
So these both work based on two attachments attachment zero and attachment one.
It doesn't matter really which way around they are, as long as one attachment is is in a different
position than the other one.
Okay.
Um, so let's add an attachment into this part here I'm going to call this attachment zero.
Let's also add a second attachment.
So let's duplicate this.
Call this um attachment one I'm going to move this just outside the parts like this here.
Now you might want this in this method.
You don't really want attachments to be outside of parts.
Um I will probably I'll probably show you in a minute, um, how this might work with two parts.
Um, an attachments kind of connect together.
But just for sake of explanation, I'm going to do this.
Okay.
Um, so the beam we're going to put in our two attachments over here.
So click on attachment zero and select your attachment zero.
Click on attachment one and select your attachment one.
And you can see a nice little beam there between those two attachments okay.
And again doesn't matter.
Um yeah.
It doesn't matter which way round is attached.
If you put attachment zero to attachment one, it's fine.
Doesn't matter too much.
Okay.
Um, so yeah, it basically puts a beam between those two attachments.
Okay.
Um, now, if I was quickly just show you how it might look with two parts, it might be a bit of a
better example, to be honest.
Move this over here.
And instead of putting this attachment one there, putting the attachment one into the second part.
Like that's fair.
Then going over to his beam and selecting VAT there, and we can see a nice little beam connecting those
two parts.
Now, the, um, the use for this was to do with lasers.
You can have maybe lasers between these, and you can edit some of the properties of the beam to make
it look like a laser.
So change the color for example, to be red light emission, you could turn on a little bit texture.
You can give it its own texture if you like.
Um transparency things like that.
Um, curves as well.
You can curve the beam slightly, but width as well.
If we're making a laser, it has to be a lot of a smaller width.
So change the width here to let's say 0.1.
Now we have two values of width width zero and a width one.
And a couple of these have um two kind of values for each property.
What these mean is this is the width at the first attachment and it's the width at the second attachment.
So we can see here we change the width of the first attachment to be 0.1 which means it's small over
here.
But then it gets larger as this one over here has a width of zero point as a width of one.
Sorry, but if you change this to be 0.1, then they both have a width of 0.1 there.
And I think it's a quite, quite a cool use of that.
And change the light emissions.
Maybe be about 0.3.
Something like that looks quite cool.
You can also add textures onto these.
I'm going to quickly show you how they work.
Let's go over to the toolbox.
Go over to images.
Let's find some kind of texture.
Um, laser.
Maybe we can find a laser.
Um.
Not many good ones.
Let's just pick this one here.
Just a random random one, but you'll be able to see it on there.
And let's go over to the beam.
Go over to texture, paste it in and we can see it actually moves like that there as well.
Okay.
So the textures actually move um, along with the beam.
So the beam isn't just like a stationary thing, it's actually moving, which I think is a really cool
thing.
I just wanted to show you their texture length, change the length of these textures and also texture
speed, increase the speed if you wanted to as well.
And I think that their looks really cool.
Um, add into a game.
Maybe it's um, some a pipe, maybe with some weird, I don't know, some weird liquid in the pipe or
just any kind of cool things like that.
It's a good thing you can definitely add it's got some uses for your game.
Okay, so that's the first one.
I think it's really cool with some really good uses as well.
The second one is to do a Betrayal Now trail, which you've probably seen in a lot of games.
They have either trails on pets or they have trails on players, and that's how this kind of works.
So for this one, I'm going to put the attachment back into the first one is this one.
You usually have the two attachments in the same part.
That zero attachment one.
Let's move it.
Attachment towards the back.
Like that.
There.
Cool.
And we trail.
Let's go to the trail.
Select the two attachment.
So attachment zero attachment one.
And that's it.
We then select these part.
Nothing happens visually to start off with.
But if we move this part we can see up.
So I need to run the game.
In order to do this we move this part.
Mm.
Okay.
Uh, what have I done wrong here?
Um.
Attachment zero.
Attachment one.
Okay.
Are visible.
Needs to be on.
Yes.
Oh, no.
Sorry.
This is attached to the attachments.
No.
Um.
What have I done wrong here?
I've done something wrong.
Um.
Enabled lifetime face camera texture transparency of zero.
Perhaps it's not working.
Hmm.
Ah, there we go.
Doesn't sure why it wasn't working first time there, but as we moved apart, you can see there's a
nice trail behind it as well.
Which is how games work when it comes to trails and things like that.
Just use this, use D2 attachments and use the trail effect there as well.
So plenty of properties you can change.
Most of them are the same.
So texture, color, um max length, minimum length quite obvious, but it's the length of the trail
and width scales the width.
Also you can change of the trail.
So not really going to talk about too much of those because I think most of them are either quite obvious
or we've already looked at them before, but it's just a good use of attachments using these two effects,
and it's really cool as well.
Um, so we did want to set up like trails for characters and things like that.
You would be using V2 attachments and we trail like that there.
Okay.
Um, so that's pretty much it.
Okay.
So have a go at using these two and see what kind of uses you can have them to in your game.
But think they do are very they both of them are quite useful and they do have quite um those two do
have quite cool uses um, in your game.
Okay.
So have a play around of those.
And in the next lesson we're going to have a look at the second think major use of attachments.
Probably probably the most most major use of attachments, which is to do with constraints.
Um, that might be split up into two lessons.
I'm not too sure depending on the length, there's quite a few constraints to get through, but constraints
or to do with physics and stuff.
So that's what we're having a look at in the next lecture.